export const set = (key: string, value: any) => {
  localStorage.setItem(key, value);
};

export const get = (key: string) => {
  const data = localStorage.getItem(key);
  return data;
};

export const setJson = (key: string, value: any) => {
  localStorage.setItem(key, JSON.stringify(value));
};

export const getJson = (key: string) => {
  const data = localStorage.getItem(key);
  if (data) {
    return JSON.parse(data);
  }
  return data;
};

export const remove = (key: string) => {
  localStorage.removeItem(key);
};

export const clear = () => {
  localStorage.clear();
};
